package edu.lingnan.rili.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import edu.lingnan.rili.pojo.Administrator;
import edu.lingnan.rili.mapper.AdministratorMapper;
import edu.lingnan.rili.service.AdministratorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 陈世杰
 * @since 2022-01-23
 */
@Service
public class AdministratorServiceImpl extends ServiceImpl<AdministratorMapper, Administrator> implements AdministratorService {

    @Autowired
    private AdministratorMapper administratorMapper;

    @Override
    public Administrator login(Integer account, String password) {
        QueryWrapper<Administrator> wrapper = new QueryWrapper<>();
        wrapper.eq("administration_id", account);
        wrapper.eq("administration_password", password);
        return administratorMapper.selectOne(wrapper);
    }
}
